# 你刚得知新购买的餐桌无法及时送达，因此只能邀请两位嘉宾。
# 以完成练习3-6时编写的程序为基础，在程序末尾添加一行代码，打印一条你只能邀请两位嘉宾共进晚餐的消息。
# 使用pop() 不断地删除名单中的嘉宾，直到只有两位嘉宾为止。每次从名单中弹出一位嘉宾时，都打印一条消息，让该嘉宾知悉你很抱歉，无法邀请他来共进晚餐。
# 对于余下两位嘉宾中的每一位，都打印一条消息，指出他依然在受邀人之列。
# 使用del 将最后两位嘉宾从名单中删除，让名单变成空的。打印该名单，核实程序结束时名单确实是空的。

friends = ["Albert Einstein", "Leonhard Euler", "Archimedes"]
print(f"Dear {friends[0]}, I want to have a dinner with you.")
print(f"Dear {friends[1]}, I want to have a dinner with you.")
print(f"Dear {friends[2]}, I want to have a dinner with you.")

print("\nHey guys, I find a larger table, and we can invite more friends.")

friends.insert(0, "Euclid")
friends.insert(2, "Gauss")
friends.append("Joseph-Louis Lagrange")

print(f"\nDear {friends[0]}, I want to have a dinner with you.")
print(f"Dear {friends[1]}, I want to have a dinner with you.")
print(f"Dear {friends[2]}, I want to have a dinner with you.")
print(f"Dear {friends[3]}, I want to have a dinner with you.")
print(f"Dear {friends[4]}, I want to have a dinner with you.")
print(f"Dear {friends[5]}, I want to have a dinner with you.")

print("\nHey guys, I have a bad news to tell you. The table I ordered can't "
      "be delivered in time.")

print(f"\nDear {friends.pop()}, I'm so sorry to tell you that I can't invite "
      f"you for dinner.")
print(f"Dear {friends.pop()}, I'm so sorry to tell you that I can't invite "
      f"you for dinner.")
print(f"Dear {friends.pop()}, I'm so sorry to tell you that I can't invite "
      f"you for dinner.")
print(f"Dear {friends.pop()}, I'm so sorry to tell you that I can't invite "
      f"you for dinner.")

print(f"\nDear {friends.pop()}, we still have dinner tonight.")
print(f"Dear {friends.pop()}, we still have dinner tonight.")

print(friends)
